<?php

namespace App\Ship\Parents\Serializers;

use League\Fractal\Serializer\ArraySerializer;

class CustomSerializer extends ArraySerializer
{
    public function collection($resourceKey, array $data): array
    {
        return $resourceKey === 'data' ? array('data' => $data) : $data;
    }

    public function item($resourceKey, array $data): array
    {
        return $resourceKey === 'data' ? array('data' => $data) : $data;
    }
}
